package zfl.fanglong.cn.service;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import zfl.fanglong.cn.dao.UserDAO;
import zfl.fanglong.cn.domain.User;

public class CheckService implements CheckIn{
 //private Logger log = Logger.getLogger(CheckService.class);
  private Log log = LogFactory.getLog(CheckService.class);
  private UserDAO userDao;
  private User user;
  private List<String> infos;
  private Infos cont;
 
 public List<User> findUser(String sql,User user){
	 return userDao.findUsers(sql,user);
 }
 public void inseretUser(String sql,User user){
	 userDao.insertUser(sql,user);
 }
 public UserDAO getUserDao() {
	return userDao;
}
public void setUserDao(UserDAO userDao) {
	this.userDao = userDao;
}
public CheckService(){}
 public CheckService(User userObj){
	 this.user = userObj;
 }
 public CheckService(User userObj,List<String> info){
	 this.user=userObj;
	 this.infos = info;
 }
  public boolean checkUser(User userFromPage){
	  log.info("checkUser is invoke");
	  if(user.equals(userFromPage)){
		  return true;
	  }
	  
	  return false;
  }
  
public User getUser() {
	return user;
}
public void setUser(User user) {
	this.user = user;
}
public List<String> getInfos() {
	return infos;
}
public void setInfos(List<String> infos) {
	this.infos = infos;
}
public Infos getCont() {
	return cont;
}
public void setCont(Infos cont) {
	this.cont = cont;
}
public List<User> insertAndFind(List<User> user) {
	// TODO Auto-generated method stub
	for(User use:user){
		userDao.insertUser("", use);
	}
	return userDao.findUsers("", null);
}

  
}
